//
//  UIImage+Extension.h
//  DoulinClient
//
//  Created by YLKJ on 2019/3/15.
//

#import <UIKit/UIKit.h>

@interface UIImage (Extension)

#pragma mark - --------------- WLCompress ----------------
/*
 *  压缩图片方法(先压缩质量再压缩尺寸)
 */
-(NSData *)compressWithLengthLimit:(NSUInteger)maxLength;
/*
 *  压缩图片方法(压缩质量)
 */
-(NSData *)compressQualityWithLengthLimit:(NSInteger)maxLength;
/*
 *  压缩图片方法(压缩质量二分法)
 */
-(NSData *)compressMidQualityWithLengthLimit:(NSInteger)maxLength;
/*
 *  压缩图片方法(压缩尺寸)
 */
-(NSData *)compressBySizeWithLengthLimit:(NSUInteger)maxLength;
/**
 *  拉伸图片 宽高比
 */
- (UIImage *)imageResizableWithName:(NSString *)imageName;

/**
 *  拉伸图片 指定区域
 */
+ (UIImage *)imageStretchableImage:(NSString *)imageName WithLeftCapWidth:(NSInteger)width topCapHeight:(NSInteger)height;


#pragma mark - -------------------------------
- (UIImage *)ylScaleToSize:(CGSize)size;
- (UIImage *)compressed;
+ (UIImage *)imageWithColor:(UIColor *)color;
- (UIImage *)zipImg;

@end
